import request from '@/utils/request'

// 公告列表
export const getNoticeList = (params) =>
  request({
    url: '/business/farmNotice/list',
    method: 'POST',
    data: params
  })

// 天气信息
export const getWeatherInfo = (params) =>
  request({
    url: `/screen/device/getWeatherInfo`,
    method: 'GET',
    params
  })

// 项目简介
export const getProjectStatics = (params) =>
  request({
    url: `/business/projectInfo/getProjectStatics`,
    method: 'GET',
    params
  })

// 大棚设备列表数据
export const getHouseDeviceList = (params) =>
  request({
    url: `/greenhouseDevice/getHouseDeviceList`,
    method: 'GET',
    params
  })

// 大屏-设备管理-设备数量统计
export const getUserDeviceCount = (params) =>
  request({
    url: `/screen/device/getUserDeviceCount`,
    method: 'GET',
    params
  })

export const getHouseDeviceWarn = (params) =>
  request({
    url: `/greenhouseDevice/getHouseDeviceWarn`,
    method: 'GET',
    params
  })

export const getHistoryDataList = (params) =>
  request({
    url: `/greenhouseDevice/getHistoryDataList`,
    method: 'GET',
    params
  })

export const getHouseDetail = (params) =>
  request({
    url: `/business/farmGreenhouseInfo/getHouseDetail`,
    method: 'GET',
    params
  })
export const getUserDeviceByType = (params) =>
  request({
    url: `/screen/device/getUserDeviceByType?deviceType=soil`,
    method: 'GET',
    params
  })

export const farmDeviceWarnRecordList = (params) =>
  request({
    url: `/business/farmDeviceWarnRecord/list`,
    method: 'POST',
    data: params
  })

export const getInfo = (params) =>
  request({
    url: `/getInfo`,
    method: 'GET',
    params
  })
export const logout = (params) =>
  request({
    url: '/logout',
    method: 'POST',
    data: params
  })

export const farmCropTaskList = (params) =>
  request({
    url: '/business/farmCropTask/list',
    method: 'POST',
    data: params
  })

//通过
export const farmCropTaskapproved = (params) =>
  request({
    url: '/business/farmCropTask/approved',
    method: 'POST',
    data: params
  })

// 驳回
export const farmCropTaskreject = (params) =>
  request({
    url: '/business/farmCropTask/reject',
    method: 'POST',
    data: params
  })

// 结束
export const farmCropTaskend = (params) =>
  request({
    url: '/business/farmCropTask/end',
    method: 'POST',
    data: params
  })

export const getProjectNews = (params) =>
  request({
    url: '/business/projectInfo/getProjectNews',
    method: 'GET',
    params: params
  })

export const flowList = (params) =>
  request({
    url: '/business/farmLandInfo/flowList',
    method: 'POST',
    data: params
  })
